package com.cike.sparkstudy.sql.java;


import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.SQLContext;

/**
 * 手动指定数据源类型
 */
public class ManuallySpecifyOptions {

    public static void main(String[] args){
        SparkConf conf = new SparkConf()
                .setMaster("local")
                .setAppName("ManuallySpecifyOptions");
        JavaSparkContext sc = new JavaSparkContext(conf);
        SQLContext sqlContext = new SQLContext(sc);

        DataFrame peoplerDF = sqlContext.read().format("json").load("/developerCodes/test/people.json");
        peoplerDF.show();
        peoplerDF.select("name").write().format("parquet").save("/developerCodes/test/peopleName_java");


    }



}
